<template>
  <!--物资管理-预警设置-新增/配置预警弹窗-->
  <j-modal :title="title" :width="1200" :visible="visible" :maskClosable="false" switchFullscreen @ok="handleOk"
     @cancel="handleCancel" okText="保存" cancelText="取消">
    <wt-yujin-form ref="realForm" @ok="submitCallback" :pageType="pageType" :disabled="disabled"
      :id="this.id" />
  </j-modal>
</template>
<script>
  import WtYujinForm from './WtYujinForm'
  export default {
    name: 'WtYujinModal',
    components: {
      WtYujinForm
    },
    data() {
      return {
        title: '',
        width: 800,
        id: '',
        visible: false,
        disabled: false,
        pageType: '',
      }
    },
    created() {
    },
    mounted() {

    },
    methods: {
      add() {
        this.visible = true
        this.$nextTick(() => {
          //this.$refs.realForm.add();
        })
      },
      edit(record) {
        this.visible = true
        this.id = record.id;
        this.$nextTick(() => {
          this.$refs.realForm.edit(record);
        })
      },
      close() {
        this.$emit('close');
        this.visible = false;
      },
      handleOk() {
        this.$refs.realForm.submitForm();
      },
      submitCallback() {
        this.$emit('ok');
        this.visible = false;
      },
      handleCancel() {
        this.close()
      }
    }
  }
</script>

<style scoped>
</style>